package com.hr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hr.entity.Functions;
import com.hr.mapper.FunctionsMapper;
import com.hr.service.FunctionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionsServiceImpl implements FunctionsService {
    @Autowired
    private FunctionsMapper functionsMapper;

    /**
     * 条件查询权限列表
     * @return
     */
    @Override
    public List<Functions> queryList(Functions functions) {
//        QueryWrapper<Functions> queryWrapper = new QueryWrapper<Functions>();
//        if(functions.getParentId()!=null){
//            queryWrapper.eq("parent_id",functions.getParentId());
//        }
//        List<Functions> list  = functionsMapper.selectList(queryWrapper);
        /**
         *根据父id查询列表
         * @param parentId
         */
        List<Functions> list =functionsMapper.queryListByParentId(functions.getParentId());
        return list;
    }
}
